package com.lu.adog.demo.common;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.lu.adog.R;
import com.lu.adog.view.MultiItemDivider;

/**
 * @author Yue
 * @date 2017/11/16 14:04
 */

public abstract class CommonListActivity extends CommonActivity {

    private void assignViews() {
        RecyclerView rvContentList = (RecyclerView) findViewById(R.id.rv_contentList_main);
        rvContentList.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
        MultiItemDivider multiItemDivider = new MultiItemDivider(this, MultiItemDivider.VERTICAL_LIST);
        multiItemDivider.setDividerMode(MultiItemDivider.END);
        rvContentList.addItemDecoration(multiItemDivider);

        bindCommonItemAdapter(rvContentList);
    }

    protected abstract void bindCommonItemAdapter(RecyclerView rvContentList);

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_commonlist);
        assignViews();

    }


}
